﻿using System;
using System.Collections.ObjectModel;
using CI.Models.Production.Interfaces;

namespace CI.Models.Production
{
    public class ProductionJob : JobBase, IIndustryJob
    {
        private IIndustryProduct _output;

        private int _runs;

        private IIndustryFacility _facility;

        private ObservableCollection<IIndustryProduct> _materials;

        private ObservableCollection<IIndustryProduct> _skills;

        private ObservableCollection<IIndustryProduct> _additionalInputs;

        public ProductionJob()
        {
            Materials = new ObservableCollection<IIndustryProduct>();
            Skills = new ObservableCollection<IIndustryProduct>();
            AdditionalInputs = new ObservableCollection<IIndustryProduct>();
            StartModel();
        }

        public Guid ParentID
        {
            get { return ParentJob == null ? Guid.Empty : ParentJob.ID; }
        }

        public IIndustryProduct Output
        {
            get { return _output; }
            internal set { SetField(ref _output, value, () => Output); }
        }

        public int Runs
        {
            get { return _runs; }
            set { SetField(ref _runs, value, () => Runs); }
        }

        public IIndustryFacility Facility
        {
            get { return _facility; }
            internal set { SetField(ref _facility, value, () => Facility); }
        }

        public ObservableCollection<IIndustryProduct> Materials
        {
            get { return _materials; }
            private set { SetField(ref _materials, value, () => Materials); }
        }

        public ObservableCollection<IIndustryProduct> Skills
        {
            get { return _skills; }
            private set { SetField(ref _skills, value, () => Skills); }
        }

        public ObservableCollection<IIndustryProduct> AdditionalInputs
        {
            get { return _additionalInputs; }
            private set { SetField(ref _additionalInputs, value, () => AdditionalInputs); }
        }
    }
}